$(function(){
    $('.btn2').click(function(){
        var info = {
            phone: $('.phone').val(),
            code: $('#xiaoyan').val(),
            username: $('.username').val(),
            password: $('.password').val()
        }
        // console.log(info);
        $.ajax({
            url: 'http://localhost:3000/users/register',
            type: 'post',
            data: info,
            success: function(res){
                console.log(res);
                alert(res.msg);
            }
        })
    })

})